package we3d.rasterizer 
{
	import we3d.View3d;
	import we3d.mesh.Face;
	import we3d.material.Surface;
	
	/**
	* Renders multiple surfaces on one polygon.
	*/
	public class LayerRasterizer implements IRasterizer
	{
		public function LayerRasterizer () {}
		
		public var surfaces:Array=[];
		
		public function addLayer (sf:Surface) :int {
			return surfaces.push(sf)-1;
		}
		
		public function draw (material:Surface, rc:View3d, f:Face) :void {
			
			var L:int = surfaces.length;
			var sf:Surface;
			
			for(var i:int=0; i<L; i++) {
				sf = surfaces[i];
				sf.rasterizer.draw(sf, rc, f);
			}
		}
	}
}
	